package com.chencl.cipher.controller;

import com.chencl.cipher.dto.ResponseBodyDTO;
import com.chencl.cipher.service.OperationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: rsa-aes-cipher-spring-boot
 * @description:
 * @author: jiangshengli
 * @create: 2022-03-18 13:42
 */
@Slf4j
@RestController
@RequestMapping("/operationLog")
@Validated
public class OperationLogController {

    @Autowired
    private OperationLogService operationLogService;


    /**
     * 查询日志列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    @PostMapping(value = "/getOperationLog")
    public ResponseBodyDTO getOperationLog(@RequestParam(required = true,defaultValue = "1") int pageNum, @RequestParam(required = true,defaultValue = "10")int pageSize){
        return ResponseBodyDTO.buildSuccess(operationLogService.getOperationLogPage(pageNum,pageSize));
    }
}
